# Contributor: Rasmus Thomsen <oss@cogitri.dev>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=feedbackd
pkgver=0.2.1
pkgrel=1
pkgdesc="Daemon to provide haptic, LED, and audio feedback triggered by application events"
url="https://source.puri.sm/Librem5/feedbackd"
arch="all"
license="GPL-3.0-or-later"
depends="dbus feedbackd-device-themes"
makedepends="
	gi-docgen
	glib-dev
	gobject-introspection-dev
	gsound-dev
	gtk-doc
	json-glib-dev
	libgudev-dev
	meson
	vala
	"
subpackages="$pkgname-dev $pkgname-doc"
source="https://storage.puri.sm/releases/feedbackd/feedbackd-$pkgver.tar.xz"
install="$pkgname.pre-install $pkgname.pre-upgrade"

build() {
	abuild-meson \
		-Db_lto=true \
		-Dgtk_doc=true \
		. output
	meson compile -C output
}

check() {
	meson test --no-rebuild --print-errorlogs -C output
}

package() {
	DESTDIR="$pkgdir" meson install --no-rebuild -C output
	install -Dm644 "$builddir"/debian/feedbackd.udev \
		"$pkgdir"/usr/lib/udev/rules.d/90-feedbackd.rules
}

sha512sums="
80dc8ce734e4ffd1455d1f3c4ac0e7f44e9d1588e6af90e1433d7aff8ada0e6c77cb06262ff762351bca20b3ccf2d8127ade04f58d4d3a69640429a14aefcafe  feedbackd-0.2.1.tar.xz
"
